/***************************************************************************
 *   Copyright (C) 2007 by Sassan Panahinejad (ico2)			   *
 *   ico2ico2@gmail.com							   *
 *                                                                         *
 *   This file is part of libaufs					   *
 *   Libaufs is free software; you can redistribute it and/or modify	   *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.				   *
 *									   *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of	   *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.			   *
 *									   *
 *   You should have received a copy of the GNU General Public License	   *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
 ***************************************************************************/
#include "aufs.h"

/*
	Takes 1 argument which is the path of the union.
	Lists the branches and says whether or not each is writable.
*/
int main(int argc, char *argv[])
{
	char *branch;
	char *branchstring;
	if (argc < 2) {
		printf("Not enough arguments\n");
		return 1;
	}
	for (branch = aufs_first_branch(argv[1], &branchstring); branch;
                        branch = aufs_next_branch(&branchstring)) {
                printf("branch: %s, writable: %d\n", branch, aufs_is_writable(argv[1], branch));
        }
	return 0;
}
